﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report_BuyStandAlone_Detail.aspx.cs"
    Inherits="EcSalseManage.EcSalse.Report_BuyStandAlone_Detail" %>

<%@ Register Src="../PageCommon/Report_Tab.ascx" TagName="Report_Tab" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>项目销售管理系统-租赁成交</title>
     <script language="javascript" type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>

    <script language="javascript" type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>

    <link href="../css/skin.css" type="text/css" rel="stylesheet">

    <script type="text/javascript">


        function checkUpload() {
            if (document.all.ddlFileType.value == "") {
                alert("请选择附件类型！");
                return false;
            }
            if (document.getElementById("txtFilePath").value == "") {
                alert("项目附件不能为空！");
                return false;
            }
        }

        function radlPropertyType_Validation(sender, args) {
            args.IsValid = ($("#radlPropertyType :radio:checked").length > 0);
        }

        function FileUploadCheck() {
            if (document.all("txtFilePath").value.length == 0) {
                alert("请选择文件！");
                document.all['txtFilePath'].focus();
                return false;
            }
            return true;
        }

        function DataCheck() {
            if (document.all.ddlFileType.value == "") {
                alert("请选择附件类型！");
                return false;
            }
            if (document.getElementById("txtFilePath").value == "") {
                alert("项目附件不能为空！");
                return false;
            }
        }

        function addRow() {
            var FilePath = document.getElementById("txtFilePath");
            if (FilePath.value == "") {
                alert("请选择上传文件");
                return false;
            }

            //            var s = FilePath.value.lastIndexOf("."); 
            //            var str2 = FilePath.value.substring(s + 1).toUpperCase();
            //            if (str2 != "JPG" && str2 != "TXT" && str2 != "XLSX" && str2 != "DOCX") {
            //                alert("格式不正确");
            //                return false;
            //            }

            var objMyTable = document.getElementById("tempTable");
            objMyTable.style.display = "block";
            var index = objMyTable.rows.length;
            var nextRow = objMyTable.insertRow(index);
            nextRow.setAttribute("style", "background-color:rgb(248, 244, 228)");

            var newCellCartonNo1 = nextRow.insertCell();
            var obj = document.getElementById("ddlFileType");
            var n = obj.selectedIndex;
            newCellCartonNo1.innerHTML = obj.options[n].text;

            document.getElementById("HiddenField1").value += "" + obj.options[n].value + "," + document.getElementById("txtFilePath").value + "," + document.getElementById("txtProjectDesc").value + "|";

            var newCellCartonNo4 = nextRow.insertCell();
            newCellCartonNo4.innerHTML = "<input style='border-width: 0px; border-style: dotted;'  onclick='deleteRow(" + index + ")'   src='..../images/delete.gif' type='image'>";
        }

        function deleteRow(obj) {

            var temp = document.getElementById("HiddenField1").value;

            temp = temp.substring(0, temp.length - 1);

            var arrayObj = temp.split("|");
            arrayObj.splice(obj - 1, 1);
            temp = "";
            for (i = 0; i < arrayObj.length; i++) {
                temp += arrayObj[i] + "|";
            }
            document.getElementById("HiddenField1").value = temp;

            document.getElementById("tempTable").deleteRow(obj);
        }
     
    </script>

    <style type="text/css">
        .style1
        {
            height: 135px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="17" valign="top" background="../images/mail_leftbg.gif">
                <img src="../images/left-top-right.gif" width="17" height="29" />
            </td>
            <td valign="top" background="../images/content-bg.gif">
                <uc1:Report_Tab ID="Report_Tab1" runat="server" Visible="False" />
            </td>
            <td width="16" valign="top" background="../images/mail_rightbg.gif">
                <img src="../images/nav-right-bg.gif" width="16" height="29" />
            </td>
        </tr>
        <tr>
            <td valign="middle" background="../images/mail_leftbg.gif">
                &nbsp;
            </td>
            <td valign="top" bgcolor="#F7F8F9">
                <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="4" valign="top">
                            <center>
                                <div id="sub1">
                                    <table>
                                              <tr>
                                   <td align="left" colspan="4" >
                                           <p>
                                          项目名称：<asp:Label ID="lblProjectName" runat="server" Text=""></asp:Label>
                                          </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="4" style="border-bottom:1px solid #cccccc;"><span id="lblTitle" style="font-size:28px;">销售成交-租赁</span><br /><br /></td>
                                </tr>
                                    <tr>
                                        <td colspan="4">&nbsp;</td>
                                    </tr>
                                        <tr>
                                            <td>
                                                成交编号
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_ReportNO" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_ReportNO"
                                                    ID="RequiredFieldValidator1" runat="server" ErrorMessage="成交编号不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                日期
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_ExchangeDate" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})"
                                                    runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_ExchangeDate"
                                                    ID="RequiredFieldValidator2" runat="server" ErrorMessage="日期不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                物业类型
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="radlPropertyType" RepeatDirection="Horizontal" runat="server">
                                                </asp:RadioButtonList>
                                                <asp:CustomValidator ID="CustomValidator1" Display="None" ClientValidationFunction="radlPropertyType_Validation"
                                                    runat="server" ErrorMessage="物业类型不能为空"></asp:CustomValidator>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblReport_BuyStandAlone_Subscribe" runat="server" Text="认购书"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Subscribe" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_Subscribe"
                                                    ID="rfvReport_BuyStandAlone_Subscribe" runat="server" ErrorMessage="认购书不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                经办人
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Operator" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_Operator"
                                                    ID="RequiredFieldValidator4" runat="server" ErrorMessage="经办人不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblReport_BuyStandAlone_SellUnit" runat="server" Text="出售单位"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_SellUnit" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_SellUnit"
                                                    ID="rfvReport_BuyStandAlone_SellUnit" runat="server" ErrorMessage="出售单位不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblReport_BuyStandAlone_Buyer" runat="server" Text="购房人"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Buyer" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_Buyer"
                                                    ID="rfvReport_BuyStandAlone_Buyer" runat="server" ErrorMessage="购房人不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblReport_BuyStandAlone_Area" runat="server" Text="购房面积"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Area" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_Area"
                                                    ID="rfvReport_BuyStandAlone_Area" runat="server" ErrorMessage="购房面积不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblReport_BuyStandAlone_Discount" runat="server" Text="折扣"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Discount" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_Discount"
                                                    ID="rfvReport_BuyStandAlone_Discount" runat="server" ErrorMessage="折扣不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                <label id="lblReport_BuyStandAlone_PayType" runat="server">
                                                    付款方式</label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_PayType" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_PayType"
                                                    ID="rfvReport_BuyStandAlone_PayType" runat="server" ErrorMessage="付款方式不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblReport_BuyStandAlone_Price" runat="server" Text="成交价"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Price" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_Price"
                                                    ID="rfvReport_BuyStandAlone_Price" runat="server" ErrorMessage="成交价不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                定金
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Margins" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_Margins"
                                                    ID="RequiredFieldValidator11" runat="server" ErrorMessage="定金不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                代理费
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_AgencyCost" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_AgencyCost"
                                                    ID="RequiredFieldValidator12" runat="server" ErrorMessage="代理费不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                挞订佣
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReport_BuyStandAlone_CancelComm" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator Display="None" ControlToValidate="txtReport_BuyStandAlone_CancelComm"
                                                    ID="RequiredFieldValidator13" runat="server" ErrorMessage="挞订佣不能为空"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label id="lblReport_BuyStandAlone_Remark" runat="server">
                                                    备注</label>
                                            </td>
                                            <td colspan="3"  align="left">
                                                <asp:TextBox ID="txtReport_BuyStandAlone_Remark" Width="100%" TextMode="MultiLine" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                      
                                        <tr>
                                            <td colspan="4">
                                                <table style="width: 100%;" class="page">
                                                    <tr>
                                                        <td>
                                                            附件类型：
                                                        </td>
                                                        <td colspan="3" align="left">
                                                            <asp:DropDownList ID="ddlFileType" runat="server">
                                                            </asp:DropDownList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left" style="font-size: 15px;">
                                                            上传文件:
                                                        </td>
                                                        <td align="left" colspan="3">
                                                            <font face="宋体">
                                                                <input id="txtFilePath" runat="server" name="UploadFile" style="font-size: 9pt; width: 388px"
                                                                    type="file" />
                                                            </font>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left" style="font-size: 15px;">
                                                            其他资料:
                                                        </td>
                                                        <td align="left" colspan="3">
                                                            <font face="宋体">
                                                                <asp:TextBox ID="txtProjectDesc" runat="server" Width="384px"></asp:TextBox></font>
                                                         
                                                            <asp:Button ID="btnUpLoad" Style="background-image: url(..../images/pic15.gif); border-color: #ffffff;
                                                                background-repeat: no-repeat; padding-left: 17px;" runat="server" Visible="false"
                                                                Text="上传" OnClick="btnUpLoad_Click" />
                                                            <asp:HiddenField ID="HiddenField1" runat="server" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td colspan="3" align="left">
                                                <table id="tempTable" style="display: none; border-width: 0px; border-style: dotted;
                                                    width: 600px; background-color: rgb(192, 255, 192);" border="0" rules="all" cellspacing="1"
                                                    cellpadding="1">
                                                    <tr style="background-color: rgb(216, 200, 168);" class="ttTable" align="center">
                                                        <td>
                                                            上传资料名称
                                                        </td>
                                                        <td style="width: 40px;">
                                                            删除
                                                        </td>
                                                    </tr>
                                                </table>
                                                <asp:DataGrid ID="dgList" Visible="false" runat="server" AutoGenerateColumns="False"
                                                    BackColor="#C0FFC0" BorderStyle="Dotted" BorderWidth="0px" CellPadding="1" CellSpacing="1"
                                                    DataKeyField="Project_Report_ID" PageSize="20" Width="600px" OnItemCommand="dgList_ItemCommand"
                                                    OnItemDataBound="dgList_ItemDataBound">
                                                    <PagerStyle Mode="NumericPages" Position="TopAndBottom" />
                                                    <AlternatingItemStyle BackColor="#F0F0E8" CssClass="td" />
                                                    <ItemStyle BackColor="#F8F4E4" CssClass="td" />
                                                    <HeaderStyle BackColor="#D8C8A8" CssClass="ttTable" HorizontalAlign="Center" />
                                                    <Columns>
                                                        <asp:HyperLinkColumn DataNavigateUrlField="Project_Report_FilePath" DataTextField="Report_File_Name"
                                                            HeaderText="上传资料名称" Target="_blank"></asp:HyperLinkColumn>
                                                        <asp:TemplateColumn HeaderText="删除">
                                                            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                                Font-Underline="False" HorizontalAlign="Center" Wrap="False" />
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="imgbtnDelete" runat="server" AlternateText="删除" BorderStyle="Dotted"
                                                                    BorderWidth="0px" CommandName="Delete" ImageAlign="Middle" ImageUrl="..../images/delete.gif" />
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="40px" />
                                                        </asp:TemplateColumn>
                                                    </Columns>
                                                </asp:DataGrid>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4" align="center">
                                                <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" CausesValidation="false" />
                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <input id="btnReset" runat="server" type="reset" value="重置" />
                                                <asp:Button ID="btnDelete" runat="server" Text="删除" Visible="false" OnClick="btnDelete_Click" />
                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <asp:Button ID="btnAudit" runat="server" OnClientClick="if(confirm('是否确定审核通过？')){return true;}else{return false;}" Text="项经审核" onclick="btnAudit_Click" />
                                            </td>
                                            <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="false"
                                                runat="server" />
                                        </tr>
                                    </table>
                                </div>
                                <div id="sub2">
                                </div>
                            </center>
                        </td>
                    </tr>
                    <tr>
                        <td height="40" colspan="4">
                            <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                                <tr>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td width="2%">
                            &nbsp;
                        </td>
                        <td width="51%" class="left_txt">
                            <img src="../images/icon-mail2.gif" width="16" height="11">
                            客户服务邮箱：servers@centaline.com<br>
                            <img src="../images/icon-phone.gif" width="17" height="14">
                            官方网站：http://www.centaline.com.cn/
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
            <td background="../images/mail_rightbg.gif">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="bottom" background="../images/mail_leftbg.gif">
                <img src="../images/buttom_left2.gif" width="17" height="17" />
            </td>
            <td background="../images/buttom_bgs.gif">
                <img src="../images/buttom_bgs.gif" width="17" height="17">
            </td>
            <td valign="bottom" background="../images/mail_rightbg.gif">
                <img src="../images/buttom_right2.gif" width="16" height="17" />
            </td>
        </tr>
    </table>
    </asp:Label>
    </form>
</body>
</html>
